package com.unicloud.medical.oss.client.properties;

import com.unicloud.medical.oss.common.constant.OSSPropertiesConstant;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Data
@ConfigurationProperties(prefix = OSSPropertiesConstant.OSS_CLIENT_PREFIX)
public class OSSClientProperties {
    private boolean enabled = true;
    private String endpoint;
    private String bucketName;
    private String ossName;

    /**
     * http
     * grpc
     * local
     */
    private String connectionType = "local";

    public void setBucketName(String bucketName) {
        this.bucketName = StringUtils.trimToNull(bucketName);
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = StringUtils.trimToNull(endpoint);
    }

    public void setOssName(String ossName) {
        this.ossName = StringUtils.trimToNull(ossName);
    }

    public void setConnectionType(String connectionType) {
        this.connectionType = StringUtils.trimToNull(connectionType);
    }
}
